home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 2 / Tech Arsenal 2 (Arsenal Computer).iso / clipper / s93bsp.exe / CL5 / QBTXTMAC.PRG < prev    next >
Encoding:
Text File  |  1993-11-26  |  1.2 KB  |  47 lines

  1. ///////////////////////////////////////////////////////////////
  2. //
  3. //  Module : QBTXTMAC.PRG
  4. //
  5. //  Created by SUMMER'93 (c) on Fri Nov 26 14:50:46 1993
  6. //
  7. ///////////////////////////////////////////////////////////////
  8. #include "snj.ch"
  9. // This procedure named after its module
  10. procedure QBTXTMAC( FNAME )
  11. // Calls: ATNEXT 
  12. // Called By: INVOUT 
  13. //       Q B T X T M A C
  14. //       Procedure to read a text file each line of which is
  15. //       a series of macros to define how info should be printed
  16. //       uses clipper file reading facilities and
  17. //       Tom Rettig function atnext()
  18.  
  19. // The following locals have been declared by Summer'93
  20. // X A Y 
  21. local BUFFER, OCC, OPOS, NPOS, MACLINE, X, A, Y
  22.  
  23. X := replicate( "A", 1 )
  24. A := "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 
  25. X := substr( A, 1, 1 )
  26. Y := chr( 32 )
  27. BUFFER := memoread( FNAME )
  28. OCC := OPOS := NPOS := 1 
  29. set print on 
  30. do while .t. 
  31.     NPOS := ATNEXT( chr(13 ), BUFFER, OCC )
  32.     if NPOS  = 0 
  33.         exit 
  34.     endif 
  35.     MACLINE := substr( BUFFER, OPOS, NPOS - OPOS )
  36.  
  37.     if substr( MACLINE, 1, 1 )<> "*" 
  38.         ?&MACLINE 
  39.     endif 
  40.     OPOS := NPOS + 2 
  41.     OCC := OCC + 1 
  42. enddo 
  43. set print off 
  44. // eject
  45. return 
  46. // End of file
  47.